﻿ module Sustainalytics.GCCS {

     export class GCUtility {

         public static getGcAssessmentUrlName(overallAssessment: GCAssessment): string {
             var urlName = null;

             switch (overallAssessment) {
                 case GCAssessment.NonCompliant:
                     urlName = "NonCompliant";
                     break;
                 case GCAssessment.Watchlist:
                     urlName = "Watchlist";
                     break;;
                 case GCAssessment.Compliant:
                     urlName = "Compliant";
                    break;
             }

             return urlName;
         }

         public static getGcAssessmentFromUrlName(overallAssessmentName: string): GCAssessment {
             var overallAssessment: GCAssessment = null;

             if (overallAssessmentName) {
                 overallAssessmentName = overallAssessmentName.toUpperCase();

                 switch (overallAssessmentName) {
                 case 'NONCOMPLIANT':
                     overallAssessment = GCAssessment.NonCompliant;
                     break;
                 case 'WATCHLIST':
                     overallAssessment = GCAssessment.Watchlist;
                     break;
                 case '':
                     overallAssessment = GCAssessment.Compliant;
                     break;
                 }
             }

             return overallAssessment;
         }
     }
 }